package com.salemanagement.controller;

import com.salemanagement.service.FrontUserService;
import com.salemanagement.vo.RechargeVo;
import com.salemanagement.vo.RegisterUserVo;
import com.three.core.entity.FrontUser;
import com.three.core.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/saleManagement/vip")
public class FrontUserController {
    @Autowired
    private FrontUserService frontUserService;
    @GetMapping("/findUserStatic")
    public R findUserStatic(){
        return frontUserService.selectAllFontUser();
    }
    @GetMapping("/register/selectPhone")
    public R selectPhone(@RequestParam String phone) {
        return frontUserService.selectByPhone(phone);
    }
    @RequestMapping("/register/sendSms")
    public R sendSms(@RequestParam String phone) {
        return frontUserService.sendSms(phone);
    }
    @RequestMapping("/register/checkSms")
    public R checkSms(@RequestParam String phone,@RequestParam String code) {
        return frontUserService.checkSms(phone,code);
    }
    @RequestMapping("/register/registerFrontUser")
    public R registerFrontUser(@RequestBody RegisterUserVo registerUserVo) {
        return frontUserService.registerFrontUser(registerUserVo);
    }
    @RequestMapping("/register/updatePass")
        public R updatePass(@RequestBody RegisterUserVo registerUserVo){
            return frontUserService.updatePass(registerUserVo);
    }
}
